/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package avanzadavectoreshilos;

/**
 *
 * @author ESTUDIANTE
 */
public class SumadorHilo implements Runnable {
    int resultado;
    
    int[] vector= new int[4];
    public SumadorHilo(int[] vector) {
        this.vector = vector;
    }

  
    @Override
    public  synchronized void run() {
        int total=0;
        for(int i=0; i<4;i++){
            total = total + vector[i];
        }
        this.resultado=total;
    }
    

}
